import request from '@/libs/http/index'

// list
export function getTaskApi(params) {
  return request({
    url: '/task',
    method: 'GET',
    params
  })
}

// create
export function addTaskApi(data) {
  return request({
    url: '/task',
    method: 'POST',
    data
  })
}

export function updateTaskApi(data) {
  return request({
    url: '/task',
    method: 'PATCH',
    data
  })
}

export function delTaskApi(id) {
  return request({
    url: `/task/${id}`,
    method: 'DELETE'
  })
}

export function detailTaskApi(id) {
  return request({
    url: `/task/${id}`,
    method: 'GET'
  })
}